<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>商品详情</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategy.css"/>
    <script src="/js/common.js"></script>
    <script src="/js/checkLogin.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>


    <link rel="stylesheet" href="/js/commodity/More.css">
    <link rel="stylesheet" href="/js/commodity/style.css"/>
    <link rel="stylesheet" href="/js/commodity/Up.css">
    <script type="text/javascript" src="/js/commodity/touch.js"></script>
    <script type="text/javascript" src="/js/commodity/srcolltop.js"></script>
    <script type="text/javascript" src="/js/commodity/timer.js"></script>
    <script type="text/javascript" src="/js/commodity/xlmenu.js"></script>
    <script>
        $(function () {
            var params =getParams();
            var productId=params.id;
            $.get(baseUrl+"products/"+params.id,function (data) {
                $(".body").renderValues(data);
            })

            $("#cart").click(function () {
                $.post(baseUrl+"users/"+user.id+"/addCars",{productId:productId},function (data) {
                    if(data.success){
                        $(document).dialog({
                            titleShow: false,
                            content: "添加成功"
                        });
                    }else {
                        $(document).dialog({
                            titleShow: false,
                            content: "添加成功"+ data.errorMsg
                        });
                    }
                })

            })
        })
    </script>
</head>
<body>
<div class="body">
    <div class="search-head">
        <div class="row nav-search" >
            <div class="col-5">
                <a href="javascript:window.history.go(-1);">
                    <span><i class="fa fa-chevron-left fa-2x"></i></span>
                </a>
            </div>
            <span><h>商品详情</h></span>
        </div>
    </div>
    <div class="allsp" style="height: 1000px;">
            <div>
                <img  render-src="imgUrl"/><br>
                <p render-html="name" style="font-size: 25px; margin-left:30px; margin-top:-10px"></p>
                <em style="margin-left:35px;color: red; ">￥
                    <span render-html="price" style="font-size: 30px;"></span>
                </em>
                <div>
                    <button type="button" class="btn btn-success btn-lg" style="margin-left:250px;margin-top:-60px;float: left; width: 110px;"
                            id="cart" >加入购物车</button>
                    <br>
                </div>
                <div class="t_remark">
                    <div class="bdsharebuttonbox" style="width: 160px;height: 15px;margin-left:0px;margin-top:0px;float: left;"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a></div>
                    <br>
                    <script>
                        window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
                    </script>
                    <p class="p_remark" style="float: right;">商品详情</p>
                    <hr/>
                </div>
            </div>
            <div style="font-size: 16px;margin-top: 50px;" render-html="productContent.content"></div>
            <div></div>
    </div>
</div>
<div class="wx_nav" id="wx_nav">
    <a href="market.html"  id="nav_index">首页</a>
    <a href="shoppingCar.html"  id="nav_shopcart">购物车</a>
    <a href="order.html"  id="nav_me on">订单</a>
</div>
</body>
</html>